package nets

import "time"

type Admin struct {
	AdminID  int `gorm:"primaryKey"`
	UserID   int
	Account  string `gorm:"size:255"`
	Password string `gorm:"size:255"`
}

type Student struct {
	StudentID int `gorm:"primaryKey"`
	UserID    int
}

type Authentication struct {
	Session string `json:"session"`
	Token   string `json:"token"`
}

type ClassActived struct {
	Index      int    `json:"Index"`
	CourseId   int    `json:"CourseId"`
	ResumeNum  int    `json:"ResumeNum"`
	CheckinNum int    `json:"CheckinNum"`
	TeacherId  int    `json:"TeacherId"`
	Max        int    `json:"Max"`
	WeekDay    int    `json:"WeekDay"`
	RecordText string `json:"RecordText"`
}

type Class struct {
	ClassId      int          `json:"ClassId"`
	ClassActived ClassActived `json:"ClassActived"`
}
type ClassTabel struct {
	// 今天星期几
	NowWeekDay    int
	ClassInOneDay [4][]ClassDetail
}
type ClassDetail struct {
	ClassId     int
	ClassInfo   ClassActived
	CourseInfo  Course
	TeacherInfo TeacherInfo
	ResumeInfo  []UserResumeInfo
}
type Teacher struct {
	UserID          int    `gorm:"size:255"`
	TeacherID       int    `gorm:"primaryKey"`
	Account         string `gorm:"size:255"`
	Password        string `gorm:"size:255"`
	InviteCode      string `gorm:"size:255"`
	Introduction    string `gorm:"type:text"`
	IntroductionURL string `gorm:"size:255"`
}
type Course struct {
	CourseId        int `gorm:"primaryKey"`
	AdminId         int
	CourseName      string `gorm:"size:255"`
	CourseSubject   string
	IntroductionURL string `gorm:"size:255"`
	Introduction    string
	IsGroupType     bool
	IsTeamType      bool
	IsVipType       bool
	RecommendMaxNum int
	RecommendMinNum int
	CreatedAt       time.Time `gorm:"autoCreateTime"`
}
type TeacherInfo struct {
	UserInfo    User
	TeacherInfo Teacher
}
type UserResumeInfo struct {
	UserId    int
	Status    int
	CheckinAt time.Time
}

type User struct {
	UserID    int
	Openid    string
	Nickname  string
	Name      string
	Gender    bool
	Signature string
	IsStudent bool
	IsTeacher bool
	IsAdmin   bool
	AvaURL    string
}
type AdminInfo struct {
	UserInfo  User
	AdminInfo Admin
}
type CourseBasic struct {
	CourseID   int    `json:"courseID"`
	CourseName string `json:"courseName"`
}
type CardComplexInfo struct {
	CardInfo          CardList      `json:"card_list"`
	SupportCourseInfo []CourseBasic `json:"support_course_info"`
	ForbidCourseInfo  []CourseBasic `json:"forbid_course_info"`
}
type CardList struct {
	CardId               int    `gorm:"primaryKey;autoIncrement"` // SERIAL PRIMARY KEY
	CardName             string `gorm:"unique;size:255"`          // VARCHAR(255) UNIQUE
	BriefIntroductionURL string `gorm:"size:255"`                 // VARCHAR(255)
	AdminAccount         string `gorm:"size:255"`                 // VARCHAR(255)
	CardIntroduction     string `gorm:"type:text"`                // TEXT
	CardIntroductionURL  string `gorm:"size:255"`                 // VARCHAR(255)
	IsSupportGroup       bool
	IsSupportTeam        bool
	IsSupportVIP         bool `gorm:"column:is_support_vip"`
	IsLimitDays          bool
	IsLimitTimes         bool
	IsForbidSpecial      bool
	IsSupportSpecial     bool
	Price                int
}
